/*
 * @Author: 朽木白
 * @Date: 2023-03-15 10:16:59
 * @LastEditors: 1547702880@@qq.com
 * @LastEditTime: 2023-03-15 14:33:18
 * @Description: 修改element默认的样式
 */

@import './variable.scss';

// 表格样式增强
.el-table {
  flex: 1;
  border-radius: $base-border-radius-lg;
  overflow: hidden;
  box-shadow: $base-box-shadow-sm;

  table {
    width: 100%;
  }

  .el-table__header th {
    font-weight: 600;
    color: $base-color-gray-700;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-bottom: 2px solid $base-color-primary;
    padding: 16px !important;
    font-size: 14px;
  }

  .el-table__body {
    tr {
      transition: all 0.2s ease;

      &:hover {
        background-color: rgba(99, 102, 241, 0.05) !important;
      }

      td {
        padding: 16px !important;
        border-bottom: 1px solid $base-border-color-extra-light;
      }
    }
  }
}

// 按钮样式增强
.el-button {
  border-radius: $base-border-radius-md;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  box-shadow: $base-box-shadow-sm;

  &:hover {
    transform: translateY(-1px);
    box-shadow: $base-box-shadow-md;
  }

  &:active {
    transform: translateY(0);
    box-shadow: $base-box-shadow-sm;
  }

  &.el-button--primary {
    background: $base-gradient-primary;
    border: none;

    &:hover {
      background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    }
  }

  &.el-button--success {
    background: $base-gradient-success;
    border: none;

    &:hover {
      background: linear-gradient(135deg, #059669 0%, #047857 100%);
    }
  }

  &.el-button--warning {
    background: $base-gradient-warning;
    border: none;

    &:hover {
      background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    }
  }

  &.el-button--danger {
    background: $base-gradient-danger;
    border: none;

    &:hover {
      background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    }
  }
}

// 输入框样式增强
.el-input {
  .el-input__wrapper {
    border-radius: $base-border-radius-md;
    box-shadow: $base-box-shadow-sm;
    transition: all 0.3s ease;

    &:hover {
      box-shadow: $base-box-shadow-md;
    }

    &.is-focus {
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
      border-color: $base-color-primary;
    }
  }
}

// 选择器样式增强
.el-select {
  .el-input__wrapper {
    border-radius: $base-border-radius-md;
    box-shadow: $base-box-shadow-sm;
    transition: all 0.3s ease;

    &:hover {
      box-shadow: $base-box-shadow-md;
    }

    &.is-focus {
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
      border-color: $base-color-primary;
    }
  }
}

// 卡片样式增强
.el-card {
  border-radius: $base-border-radius-lg;
  box-shadow: $base-box-shadow-sm;
  transition: all 0.3s ease;
  background: $base-gradient-card;
  backdrop-filter: blur(10px);

  &:hover {
    box-shadow: $base-box-shadow-lg;
    transform: translateY(-2px);
    background: $base-gradient-card-hover;
  }

  .el-card__header {
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid $base-border-color-extra-light;
    padding: $base-spacing-xl;
  }

  .el-card__body {
    padding: $base-spacing-xl;
  }
}

// 开关样式增强
.el-switch {
  &.is-checked {
    .el-switch__core {
      background: $base-gradient-primary;
      border-color: $base-color-primary;
    }
  }

  .el-switch__core {
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
    }
  }
}

// * el-drawer 样式
.el-drawer {
  .el-drawer__header {
    padding: 15px 20px 14px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--el-border-color-lighter);

    span {
      font-size: 17px;
      color: var(--el-text-color-primary) !important;
    }
  }

  .el-drawer__footer {
    border-top: 1px solid var(--el-border-color-lighter);
  }

  span {
    font-size: 14px;
    color: var(--el-text-color-primary) !important;
  }

  // drawer select 样式
  .el-select {
    width: 100%;
  }

  // drawer-form 中存在两列 form-item
  .drawer-multiColumn-form {
    display: flex;
    flex-wrap: wrap;

    .el-form-item {
      width: 47%;

      &:nth-child(2n-1) {
        margin-right: 5%;
      }
    }
  }
}

// * el-dialog 样式
.el-dialog {
  .el-dialog__header {
    padding: 15px 20px;
    margin: 0;
    border-bottom: 1px solid var(--el-border-color-lighter);

    .el-dialog__title {
      font-size: 17px;
    }
  }
}
